home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 May
/
EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso
/
softwareupdate
/
system
/
amigados
/
advancedroutines
/
examples.doc
< prev
next >
Wrap
Text File
|
1996-10-10
|
3KB
|
80 lines
7 ADVANCED AMIGADOS ROUTINES - EXAMPLES
Example 1
This example demonstrates how to use the Examine() function.
The program needs a file, directory or volume name as the
only argument and it will print some interesting information
about given the object.
This example can be used with all versions of the dos
library.
Example 2
This example does exactly the same thing as the previous one,
it simply demonstrates how to use the Examine() function.
However, this example uses the new AllocDosObject() and
FreeDosObject() functions which were introduced in Release 2.
You should use these new functions (if possible) instead of
using the older method of allocating a fixed amount of memory
for the dos object (the FileInfoBlock structure).
This example can only be used with dos library V37 or higher.
Example 3
This example demonstrates how to examine all objects in
directory or volume. The program needs a directory or
volume name as the only argument and it will then list
all files and directories (subdirectories) in that
directory or volume. This is a good example on how to
use the Examine() and ExNext() functions.
This example can be used with all versions of the dos
library.
Example 4
This program will examina all objects in a directory/device.
The files will be listed, and if finds a directory it will
with help of a recursive function examine all objects in
that directory also and so on... Good example on how to use
the Examine() and ExNext() functions in a recursive program.
This example can be used with all versions of the dos
library.
Example 5
This example demonstrates how to use the Info() function
to get some information about a disk. We will, among many
things, check if the disk is write protected or not, what
type of disk it is etc... In this example we examine the
disk in "df0:".
This example can be used with all versions of the dos
library.
Example 6
This example will examine some of the "lowest" parts in
AmigaDOS. It will look up and print all Assigns, Volumes
and Devices AmigaDOS knows about. Please note that we
will dig fairly deep down into the system, and only
experienced programmers are recommended to do this. I
have added a lot of comments to help you, and if you cut
out parts of this example carefully you should be able
to use it in your own programs.
This example can be used with all versions of the dos
library.
Example 7
This example will as the previous one examine the special
lists of available Assigns, Volumes and Devices. This
example will however add the volume name to the device
in which the volume is. We will also only print the
devices (with their volume name) which are currently
available to access. We will for example not print the
device "df0:" if there is not a disk in that drive.
However, if there is a disk in the drive we will both
print the device name and the name of the volume which is
in that device. We will therefore get a list which is
identical to the one used by the ASL file requeter.